﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;

namespace Taxes.TaxesReport
{
    public partial class Report3 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var bll = new BLL.ysys_user();
                var department = bll.GetDepartment();
                var deparments = new List<Model.ysys_user>() { new Model.ysys_user() { user_department = "全部" } };
                deparments.AddRange(department);
                this.storeDepartment.DataSource = deparments;

                storeDepartment.DataBind();
            }
        }
        public void RadioButtonCheck(object sender, DirectEventArgs args)
        {
        }

        public void CmbDepartmentSelect(object sender, DirectEventArgs args)
        {
            if (cmbDepartment.SelectedItem.Text == "全部")
            {
                storePerson.RemoveAll();
            }
            else
            {
                var bll = new BLL.ysys_user();
                //var person = bll.GetModelList("");
                var person = bll.GetUsersByDepatment(cmbDepartment.SelectedItem.Text);
                var persons = new List<Model.ysys_user> (){ new Model.ysys_user(){ ID=0, user_tname="全部"}};
                persons.AddRange(person);
                storePerson.DataSource = persons;
                storePerson.DataBind();
            }
        }
    }
}